<?php
session_start();
if(isset($_SESSION['admin_id'])) {
include "../../include/dbFunctions.php";
include("../../include/mail/mailFunctions.php");
$id=$_GET['id'];
$query="UPDATE event SET event_status = 'cancelled',
                            last_modified = NOW() WHERE event_id = $id";
$result = executeQuery($query);
if ($result!=0) {
    $_SESSION['mes']="The record has been updated successfully";
} else {
    $_SESSION['mes']="Error with database. Please update it manually";
}
header('Location: ' . $_SERVER['HTTP_REFERER']);
?>
    <?php
}else {
    header("Location: ../include/login.html");
}
?>